import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:search_people/page/dynamic/subs/dynamic_leaders/cell.dart';
import 'package:search_people/utils/component/component.dart';
import 'package:search_people/value/topcolors.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class DynamicAllPage extends GetView<DynamicAllController> {
  const DynamicAllPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    return ListView.builder(
      padding: EdgeInsets.symmetric(horizontal: 12.r),
      itemBuilder: (_, idx) {
        return DynamicLeaderCell();
      },
      itemCount: 20,
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<DynamicAllController>(
      builder: (_) {
        return Scaffold(
          appBar:
              detailAppBar(context, title: controller.state.title, actions: [
            IconButton(
              key: controller.state.sortKey,
              onPressed: controller.actionDropDown,
              icon: Icon(
                Icons.sort,
                color: TopColors.black_33,
              ),
            ),
          ]),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
